package com.sfj.system.controller;

import com.kaka.starter.control.dto.ResultBean;
import com.sfj.system.enums.DeptEnum;
import com.sfj.system.service.group.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kaka
 * @Date 2025/06/28
 */
@RestController
public class StaticController {

    @Autowired
    private GroupService groupService;

    @GetMapping("/org/list")
    public ResultBean getOrgTree() {
        return ResultBean.succeed(groupService.buildGroupTree());
    }

    @GetMapping("/dept/list")
    public ResultBean getAllDepts() {
        return ResultBean.succeed(DeptEnum.getAll());
    }
}

